package com.ymm.lulutong.mapper;

import com.ymm.lulutong.entity.Notice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author rg
 */
@Mapper
public interface ShipperNoticeMapper {
    void add(Notice notice);

    Notice getByNoticeId(Long noticeId);

    void setReadStatus(@Param("noticeId") Long noticeId, @Param("isRead") Boolean isRead);

    int countNoticeUnread(Long shipperId);

    int countNoticeUnreadByNoticeType(@Param("shipperId") Long shipperId, @Param("noticeType") Integer noticeType);

    List<Notice> listNoticesByNoticeIds(List<Long> noticeIds);

    void batchSetReadStatus(@Param("noticeIds") List<Integer> noticeIds, @Param("isRead") boolean isRead);

    List<Notice> listNoticesByShipperId(Long shipperId);

    List<Notice> listNoticesByShipperIdAndNoticeType(@Param("shipperId") Long shipperId, @Param("noticeType") Integer noticeType);
}
